import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

import platframe from "./modules/platframe"; // 平台业务
import pubBusiness from "./modules/pubBusiness/index"; // 公共业务
import srvAssurance from "./modules/srvAssurance/index"; // 服务保障
import realAssets from "./modules/realAssets/index"; // 服务资产

const routes = [
  {
    path: "/",
    redirect: "/mainFrame",
  },
  ...platframe, // 平台业务
  ...pubBusiness, // 公共业务
  ...srvAssurance, // 服务保障
  ...realAssets, // 服务保障
  {
    path: "/welcome",
    name: "welcome",
    meta: {
      title: "welcome",
    },
    component: () => import("@/views/system/welcome.vue"),
  },
  {
    path: "/403",
    name: "403",
    meta: {
      title: "403",
    },
    component: () => import("@/views/system/403.vue"),
  },
  {
    path: '*',
    name: '404',
    meta: {
      title: "404",
    },
    component: () => import("@/views/system/404.vue"),
  },
];

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes,
});
export default router;
